<?
global $base_dir;
$base_dir='../../';

/**** 模块调用*****/
include_once($base_dir."inc/inc_connect.php");		//通用函数包含文件
include_once($base_dir."inc/ClassUpfile.php");		//图片上传类

include_once("../index_inc.php");
include_once("../func/function.php");
include_once($base_dir."inc/manage.php");			//后台通用包含文件
?>
<?
if(is_array($_GET))
{
	foreach($_GET as $key => $value)
	{
		$$key=$value;
	}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>后台管理系统</title>
</head>
<body>
<?
$t=new Tbl_Act('web_newslist','id');
$t_num=$t->RsCount('');
$pagesize=20;
$pages=ceil($t_num/$pagesize);
if($page>$pages)
{
	$page=$pages;
}
if($page<1)
{
	$page=1;
}
$limit1=($page-1)*$pagesize;
$rows=$t->GetAll('id'," order by id desc limit $limit1,$pagesize");
if(is_array($rows))
{
	foreach($rows as $key => $row)
	{
		$path1=WEBDOMAIN."/news/indexView.php?id=".$row['id'];
		$path2='../../../html/News/';
		$filename="news_".$row['id'].".html";
		if(Createhtml($filename,$path1,$path2))
		{
			echo $row['id']."更新完毕！<br/>";
		}
		else
		{
			echo $row['id']."更新失败！<br/>";
		}
	}
}
if($page>=$pages)
{
	echo "新闻更新完毕";
}
else
{
	$page++;
	echo '<script language="javascript">setTimeout("location.href=\'?page='.$page.'\'",2000);</script>';
}
?>
<!-- 7caihu.com Baidu tongji analytics -->
<script type="text/javascript">
var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://");
document.write(unescape("%3Cscript src='" + _bdhmProtocol + "hm.baidu.com/h.js%3Fb8797ecb21d1ccb839c35b190277a0cd' type='text/javascript'%3E%3C/script%3E"));
</script>
</body>
</html>
<?
include_once($base_dir."inc/inc_unconnect.php")
?>